import time as _time
import torch as _torch
from src.networks import XintongNetwork as _use_net

_name = str(__name__)
_time = _time.strftime('%m-%d %H:%M:%S', _time.localtime())


USE_NET = _use_net

# Dataset
DATASET_PROC_METHOD_TRAIN = 'Random'
DATASET_PROC_METHOD_VAL = 'Rescale'
#
# Category
# CATEGORY_CLASS_FILE = 'category_class_coarse.txt'
MAX_CATEGORY_NUM = 1  #Not USE

# NetWork相关
IMAGE_EMBED_SIZE = 512


# WEIGHT
WEIGHT_IMAGE_TEXT = 1.0
F_WEIGHT_SPARSE_SOFTMAX = 1.0
B_WEIGHT_SPARSE_SOFTMAX = 1.0

# Word Embdding 相关
USE_PRETRAINED_WORD_EMBEDDING = True
WORD_EMBED_SIZE = 300  # 这个是和之前word2vec保持一致的
MAX_VOCAB_SIZE = 2500
OUTFIT_NAME_PAD_NUM = 10 # 保留那么多单词
###


# TRAIN：训练时选项
NUM_EPOCH = 40
LEARNING_RATE = 0.2
LEARNING_RATE_DECAY = 0.8
LEARNING_RATE_DECAY_EVERY_EPOCHS = 2
GRADIENT_CLIP = 5
BATCH_SIZE = 10
SAVE_EVERY_STEPS = 10000
SAVE_EVERY_EPOCHS = 1

# VAL：测试时选项
VAL_WHILE_TRAIN = True
VAL_FASHION_COMP_FILE = "fashion_compatibility_small.txt"
VAL_FITB_FILE = "fill_in_blank_test_small.json"
VAL_BATCH_SIZE = 8
VAL_EVERY_STEPS = 1000
VAL_EVERY_EPOCHS = 1
VAL_START_EPOCH = 1

# auto
device = _torch.device('cuda:0' if _torch.cuda.is_available() else 'cpu')
TRAIN_DIR = 'runs/%s/' % _name + _time
VAL_DIR = 'runs/%s/' % _name + _time
MODEL_NAME = '%s' % _name

